﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class RolesManage_ResetPassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string uname = this.TextBox1.Text.Trim();
        if (Membership.FindUsersByName(uname).Count == 0)
        {
            string str1 = "用户名不存在！";
            ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script>alert('" + str1 + "');</script>");
        }
        else
        {
            string str2 = "密码重置成功！";
            Membership.FindUsersByName(uname)[uname].ChangePassword(Membership.FindUsersByName(uname)[uname].GetPassword(), "000000");
            ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script>alert('" + str2 + "');</script>");
        }
    }
}
